import axios from '../libs/api.request.js'

export const loginPassword = data => {
  return axios.request({
    url: "api/login/loginPassword",
    method: "post",
    data: data
  })
}

export const loginPw = data => {
  return axios.request({
    url: "api/login/loginP",
    method: "get",
    data: data
  })
}

export const getPhoneCode = loginName => {
  const data = {
    loginName: loginName,
  }

  return axios.request({
    url: "api/login/getPhoneCode",
    method: "post",
    data: data
  })
}

export const addCustomer = (loginName, password,inviterId) => {
  const data = {
    loginName: loginName,
    password: password,
    inviterId: inviterId,
  }
  return axios.request({
    url: "api/login/addCustomer",
    method: "post",
    data: data
  })
}

export const updateCustomer = (loginName, password) => {
  const data = {
    loginName: loginName,
    password: password
  }
  return axios.request({
    url: "api/login/updateCustomer",
    method: "post",
    data: data
  })
}

export const checkLoginPhone = loginName => {
  const data = {
    loginName: loginName,
  }
  return axios.request({
    url: "api/login/checkLoginPhone",
    method: "post",
    data: data
  })
}


